<?php

namespace XiaoZhuBundle\Controller\Api;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use XiaoZhuBundle\Helper\MyController;
/**
 * @Route("/Api")
 */
class IndexController extends MyController
{
    /**
     * @param Request $request
     * @Route("/Index", name="ApiIndex")
     * @return json
     */
    public function ApiIndex(Request $request)
    {
        $data = array();
        //轮播图
        $banners = array(
            array("id"=>"","img"=>"/app/index/index1.jpg"),
            array("id"=>"","img"=>"/app/index/index2.jpg"),
        );
        $data["banners"] = $banners;
        //分类筛选
        $data["class_data"] = array(
            array("img"=>"/app/index/index_new_cate_1.png","type"=>0),
            array("img"=>"/app/index/index_new_cate_2.png","type"=>1),
            array("img"=>"/app/index/index_new_cate_3.png","type"=>2),
            array("img"=>"/app/index/index_new_cate_4.png","type"=>3)
        );
        //主题活动
        $data["index_data"] = array(
            array("type"=>1,"starType"=>0,"starLocation"=>array( "x"=>"0.67","y"=>"0.75"),"id"=>"","img"=>"/app/index/1.png"),
            array("type"=>0,"starType"=>1,"starLocation"=>array( "x"=>"0.27","y"=>"0.35"),"id"=>"","img"=>"/app/index/2.png"),
            array("type"=>1,"starType"=>1,"starLocation"=>array( "x"=>"0.0","y"=>"0.4"),"id"=>"","img"=>"/app/index/demo_3.png"),
            array("type"=>0,"starType"=>2,"starLocation"=>array( "x"=>"0.1","y"=>"0.57"),"id"=>"","img"=>"/app/index/demo_4.png"),
            array("type"=>0,"starType"=>0,"starLocation"=>array( "x"=>"0.23","y"=>"0.20"),"id"=>"","img"=>"/app/index/demo_5.png"),
            array("type"=>2,"starType"=>1,"starLocation"=>array( "x"=>"0.3","y"=>"0.75"),"id"=>"","img"=>"/app/index/demo_6.png"),
            array("type"=>2,"starType"=>2,"starLocation"=>array( "x"=>"0.11","y"=>"0.11"),"id"=>"","img"=>"/app/index/demo_7.png")
        );
        return $this->json_out(1,"",$data);
    }

    /**
     * @param Request $request
     * @Route("/Tests", name="ApiTest")
     * @return json
     */
    public function test(Request $request)
    {
        return $this->json_out(1,"",$_FILES);
    }
}
